package usersManagement.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import usersManagement.model.Organization;
import usersManagement.model.Shipment;

import java.util.List;

/**
 * User: eluibon
 * Date: 04/01/13
 * Time: 16.17
 */
public interface ShipmentRepository extends JpaRepository<Shipment, Long> {

    @Query("select s from Shipment s where s.organization = ?1")
    List<Shipment> findAvailableShipments(Organization organization);
}
